The test ideal τ(R) of a ring R of prime characteristic is an important object in the theory of tight closure. In this paper, we study a generalization of the test ideal, which is the ideal τ(at) associated to a given ideal a with rational exponent t ≥ 0. We first prove a key lemma of this paper (Lemma 2.1), which gives a characterization of the ideal τ(at). As applications of this key lemma, we generalize the preceding results on the behavior of the test ideal τ(R). Moreover, we prove an analogue of so-called Skoda’s theorem, which is formulated algebraically via adjoint ideals by Lipman in his proof of the “modified Briançon-Skoda theorem.”